package com.yunji.cabinet.service.impl;

import com.yunji.cabinet.bo.BindCodeRemoteBO;
import com.yunji.cabinet.bo.BindCodeSelectQueryBO;
import com.yunji.cabinet.dao.IBindCodeDao;
import com.yunji.cabinet.domain.DeviceBindDO;
import com.yunji.cabinet.service.IBindCodeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * @version 1.0
 * @Project: yunji-coffee
 * @Package com.yunji.cabinet.service.impl
 * @FileName BindCodeServiceImpl.java
 * @Copyright Copyright © 2024 云集互联. All Rights Reserved
 * Company		com
 * @CreateTime 2024-03-30 10:02:33
 * @Description 货柜绑定接口
 * @Modification Author                    History Time			Version				Description
 * --------------------------------------------------------------------------------
 * HuaAo				2024-03-30 10:02:33		1.0					1.0 Version
 * @since JDK 1.8.0_202
 */
@Service
public class BindCodeServiceImpl implements IBindCodeService {

    @Resource
    private IBindCodeDao bindCodeDao;

    /**
     * @param bindCode 二维码芯片绑定信息
     * @Title create
     * @Desc 创建二维码芯片绑定信息
     * @Date 2024-06-07 14:28:10.204
     * @Return boolean 创建结果
     */
    @Override
    public boolean create(DeviceBindDO bindCode) {
        return bindCodeDao.save(bindCode);
    }

    /**
     * @param bindCode 二维码芯片绑定信息
     * @Title update
     * @Desc 更新二维码芯片绑定信息
     * @Date 2024-06-07 14:29:23.386
     * @Return boolean 更新结果
     */
    @Override
    public boolean update(DeviceBindDO bindCode) {
        return bindCodeDao.updateById(bindCode);
    }

    /**
     * @Title delete
     * @Desc 删除二维码芯片绑定信息
     * @Date 2024-06-07 15:26:04.701
     * @Return boolean 删除结果
     */
    @Override
    public boolean delete(BindCodeRemoteBO bo) {
        return bindCodeDao.delete(bo);
    }

    @Override
    public DeviceBindDO select(BindCodeSelectQueryBO bo) {
        return bindCodeDao.select(bo);
    }

    @Override
    public boolean removeByImeiOrQrCode(BindCodeRemoteBO bindCodeRemoteBO) {
        return bindCodeDao.removeByImeiOrQrCode(bindCodeRemoteBO);
    }
}
